﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="m_comment.ascx.cs" Inherits="administrator_uc_admin_m_comment" %>
<%@ Register src="~/administrator/uc_admin/mn_top.ascx" tagname="mn_top" tagprefix="uc1" %>
<%@ Register src="~/administrator/uc_admin/mn_bottom.ascx" tagname="mn_bottom" tagprefix="uc2" %>
<script type="text/javascript">

    /***********************************************
    * Cool DHTML tooltip script II- © Dynamic Drive DHTML code library (www.dynamicdrive.com)
    * This notice MUST stay intact for legal use
    * Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
    ***********************************************/

    var offsetfromcursorX = 12 //Customize x offset of tooltip
    var offsetfromcursorY = 10 //Customize y offset of tooltip

    var offsetdivfrompointerX = 10 //Customize x offset of tooltip DIV relative to pointer image
    var offsetdivfrompointerY = 14 //Customize y offset of tooltip DIV relative to pointer image. Tip: Set it to (height_of_pointer_image-1).

    document.write('<div id="dhtmltooltip"></div>') //write out tooltip DIV
    document.write('<img id="dhtmlpointer" src="../images/icons/arrow2.gif">') //write out pointer image

    var ie = document.all
    var ns6 = document.getElementById && !document.all
    var enabletip = false
    if (ie || ns6)
        var tipobj = document.all ? document.all["dhtmltooltip"] : document.getElementById ? document.getElementById("dhtmltooltip") : ""

    var pointerobj = document.all ? document.all["dhtmlpointer"] : document.getElementById ? document.getElementById("dhtmlpointer") : ""

    function ietruebody() {
        return (document.compatMode && document.compatMode != "BackCompat") ? document.documentElement : document.body
    }

    function ddrivetip(thetext, thewidth, thecolor) {
        if (ns6 || ie) {
            if (typeof thewidth != "undefined") tipobj.style.width = thewidth + "px"
            if (typeof thecolor != "undefined" && thecolor != "") tipobj.style.backgroundColor = thecolor
            tipobj.innerHTML = thetext
            enabletip = true
            return false
        }
    }

    function positiontip(e) {
        if (enabletip) {
            var nondefaultpos = false
            var curX = (ns6) ? e.pageX : event.clientX + ietruebody().scrollLeft;
            var curY = (ns6) ? e.pageY : event.clientY + ietruebody().scrollTop;
            //Find out how close the mouse is to the corner of the window
            var winwidth = ie && !window.opera ? ietruebody().clientWidth : window.innerWidth - 20
            var winheight = ie && !window.opera ? ietruebody().clientHeight : window.innerHeight - 20

            var rightedge = ie && !window.opera ? winwidth - event.clientX - offsetfromcursorX : winwidth - e.clientX - offsetfromcursorX
            var bottomedge = ie && !window.opera ? winheight - event.clientY - offsetfromcursorY : winheight - e.clientY - offsetfromcursorY

            var leftedge = (offsetfromcursorX < 0) ? offsetfromcursorX * (-1) : -1000

            //if the horizontal distance isn't enough to accomodate the width of the context menu
            if (rightedge < tipobj.offsetWidth) {
                //move the horizontal position of the menu to the left by it's width
                tipobj.style.left = curX - tipobj.offsetWidth + "px"
                nondefaultpos = true
            }
            else if (curX < leftedge)
                tipobj.style.left = "5px"
            else {
                //position the horizontal position of the menu where the mouse is positioned
                tipobj.style.left = curX + offsetfromcursorX - offsetdivfrompointerX + "px"
                pointerobj.style.left = curX + offsetfromcursorX + "px"
            }

            //same concept with the vertical position
            if (bottomedge < tipobj.offsetHeight) {
                tipobj.style.top = curY - tipobj.offsetHeight - offsetfromcursorY + "px"
                nondefaultpos = true
            }
            else {
                tipobj.style.top = curY + offsetfromcursorY + offsetdivfrompointerY + "px"
                pointerobj.style.top = curY + offsetfromcursorY + "px"
            }
            tipobj.style.visibility = "visible"
            if (!nondefaultpos)
                pointerobj.style.visibility = "visible"
            else
                pointerobj.style.visibility = "hidden"
        }
    }

    function hideddrivetip() {
        if (ns6 || ie) {
            enabletip = false
            tipobj.style.visibility = "hidden"
            pointerobj.style.visibility = "hidden"
            tipobj.style.left = "-1000px"
            tipobj.style.backgroundColor = ''
            tipobj.style.width = ''
        }
    }

    document.onmousemove = positiontip

</script>
<div id="managecontent">
    <div id="managecontent_title">
        <h3>QUẢN LÝ ĐÁNH GIÁ SẢN PHẨM: 
          <font color="red"><asp:Literal ID="ltProductName" runat="server"></asp:Literal></font></h3>
    </div>
    <br class="clrfix" />
    <div id="managecontent-header">
        <div id="managecontent_feature2">
        <script language="javascript">
            function CallFuncEditItem() {
                document.getElementById('<%= btnEditItem.ClientID%>').click();
            }
            function CallFuncDeleteItem() {
                if (confirm('Bạn có muốn xóa không?')) {
                    document.getElementById('<%= btnDeleteItem.ClientID%>').click();
                }
            }
        </script>
        <a href="../administrator/default.aspx?mod=m_products" title="Quay trở lại"><img src="../images/icons/icon_back.jpg" border="0px" /><b>Quay trở lại</b></a>  
        <uc1:mn_top ID="mn_top" runat="server" />
        </div>                
        <div id="managecontent_search2">
            <%--<asp:Literal ID="ltresultSearch" runat="server"></asp:Literal>
            <asp:TextBox ID="txtKeyWord" runat="server"></asp:TextBox>
            <asp:LinkButton ID="lbtSearch" runat="server"            
                onclick="lbtSearch_Click"> <img src="../images/icons/icon_search.gif" border="0px" /><b>Tìm Kiếm</b> </asp:LinkButton>--%>
        </div>
    </div>
    <br class="clrfix" />
    <asp:GridView ID="gv_ManageControl" runat="server" AutoGenerateColumns="False" 
        DataKeyNames="ID" Width="910px" AllowPaging="True"
        onpageindexchanging="gv_ManageControl_PageIndexChanging" PageSize="20" 
        AllowSorting="True" onsorting="gv_ManageControl_Sorting" 
        onrowcommand="gv_ManageControl_RowCommand">
        <Columns>
             <asp:TemplateField > 
                <HeaderTemplate>
                    <input id="checkAll" style="float:left;" onclick="javascript:SelectAllCheckBoxes(this);" 
                          runat="server" type="checkbox" />
                </HeaderTemplate>            
                <ItemTemplate>
                    <asp:CheckBox ID="chkCheck" runat="server" />
                    <asp:HiddenField ID="hdItemKeyFieldID" runat="server" Value='<%#Bind("ID") %>' />
                </ItemTemplate>
             </asp:TemplateField>    
             <asp:TemplateField HeaderText="Họ tên"> 
                 <ItemTemplate>
                    <a onMouseout="hideddrivetip()" onMouseover="ddrivetip('<%# Eval("Body") %>', 300)"; href="javascript:void(0);"><%# Eval("FullName") %></a>
                 </ItemTemplate>            
             </asp:TemplateField>
             <asp:TemplateField HeaderText="Email"> 
                 <ItemTemplate>
                    <a onMouseout="hideddrivetip()" onMouseover="ddrivetip('<%# Eval("Body") %>', 300)"; href="javascript:void(0);"><%# Eval("Email") %></a>
                 </ItemTemplate>            
             </asp:TemplateField>
             <asp:TemplateField HeaderText="Tiêu đề"> 
                 <ItemTemplate>
                    <a onMouseout="hideddrivetip()" onMouseover="ddrivetip('<%# Eval("Body") %>', 300)"; href="javascript:void(0);"><%# Eval("Title") %></a>
                 </ItemTemplate>            
             </asp:TemplateField>
             <asp:BoundField DataField="Created" HeaderText="Created" SortExpression="Created" DataFormatString="{0:dd/MM/yyyy}"/>
             <asp:BoundField DataField="Modified" HeaderText="Modified" SortExpression="Modified" DataFormatString="{0:dd/MM/yyyy}"/>               
             <asp:TemplateField HeaderText="Hiển thị">
                <ItemStyle HorizontalAlign="Center" Width="70px" />
                <ItemTemplate>
                    <asp:LinkButton ID="lbtEditShowComment" runat="server" CommandName="EditShowCommment" CommandArgument='<%#Bind("ID") %>' CausesValidation="false" >
                        <img  src='<%#"../images/icons/"+ Eval("Image") %>' title='<%# Eval("_Active") %>' />  
                    </asp:LinkButton>                                       
                </ItemTemplate>
             </asp:TemplateField>            
            <asp:TemplateField HeaderText="Sửa">
                <ItemStyle HorizontalAlign="Center" Width="30px" />
            <ItemTemplate> 
                 <a href="javascript:EditItem('e_comment','EditItem','<%# Eval("ID") %>','560','300');" title="Sửa"><img src="../images/icons/icon_edit.bmp" border="0px"/></a>            
            </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="Xóa">
            <ItemStyle HorizontalAlign="Center" Width="30px" />
            <ItemTemplate>
                 <a href="javascript:DeleteItem('tbl_CommentProduct','ID','','<%# Eval("ID") %>', '<%# Eval("FullName") %>','1');" title="Xóa"><img src="../images/icons/icon_delete.jpg" border="0px"/></a>                        
            </ItemTemplate>
            </asp:TemplateField>
        </Columns>
        <FooterStyle BackColor="Silver" />
        <HeaderStyle Font-Bold="True" BackColor="Silver" Font-Size="14px" 
            Height="26px" />
        <PagerSettings FirstPageText="trang đầu-" LastPageText="-trang cuối" 
            Mode="NumericFirstLast" NextPageText="-trang sau-" 
            PreviousPageText="-trang trước-" Position="TopAndBottom" />
        <PagerStyle BackColor="Silver" />
        <RowStyle Height="25px" CssClass="rowStyle" />
    </asp:GridView>
    <br class="clrfix" />
    <div id="AddNewItem">
        <uc2:mn_bottom ID="mn_bottom" runat="server" />
        <asp:HiddenField ID="hdItemID" runat="server" />
        <asp:Button ID="btnEditItem" runat="server" CssClass="featurehidden" onclick="btnEditItem_Click" />
        <asp:Button ID="btnDeleteItem" runat="server" CssClass="featurehidden" onclick="btnDeleteItem_Click" />
    </div>
</div>